//===============================================================================
// Microsoft patterns & practices
// Web Client Software Factory
//-------------------------------------------------------------------------------
// Copyright (C) Microsoft Corporation.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//-------------------------------------------------------------------------------
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===============================================================================
using System.ComponentModel;
using System.Workflow.Activities;
using System.Workflow.ComponentModel;

namespace WCSFContrib.PageFlow.WorkflowFoundation.Activities
{
	//TODO: Use dependency property to bind the DefaultTransition to Child EventDrivenActivities
	/// <summary>
	/// An <see cref="StateActivity">StateActivity</see> that represents a web page in a PageFlow
	/// </summary>
	public class PageState : StateActivity
	{
		/// <summary>
		/// <see cref="DependencyProperty">DependencyProperty</see> that enables the Url property
		/// </summary>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2211:NonConstantFieldsShouldNotBeVisible", Justification = "Required by WF")]
        public static DependencyProperty UrlProperty =
			DependencyProperty.Register("Url", typeof (string), typeof (PageState));

		/// <summary>
		/// <see cref="DependencyProperty">DependencyProperty</see> that enables the DefaultTransition property
		/// </summary>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2211:NonConstantFieldsShouldNotBeVisible", Justification = "Required by WF")]
        public static DependencyProperty DefaultTransitionProperty =
			DependencyProperty.Register("DefaultTransition", typeof (string), typeof (PageState));

		/// <summary>
		/// Gets or sets the absolute or relative page url mapped to this state"
		/// </summary>
		[Editor()]
		[Description("Page url mapped to this state (relative or absolute)")]
		[Category("Metadata")]
		[Browsable(true)]
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]
        public string Url
		{
			get { return ((string) (base.GetValue(UrlProperty))); }
			set { base.SetValue(UrlProperty, value); }
		}

		/// <summary>
		/// Gets or sets the default transition name
		/// </summary>
		[Editor()]
		[Description("Default transition name")]
		[Category("Metadata")]
		[Browsable(true)]
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
		public string DefaultTransition
		{
			get { return ((string) (GetValue(DefaultTransitionProperty))); }
			set { SetValue(DefaultTransitionProperty, value); }
		}
	}
}
